#include "Reset.h"
#include "Periodic.h"
#include "Commands.h"
#include "Protocol.h"

void(* _restartArduino) (void) = 0; //declare restart function @ address 0, does not reset everything

void ResetArduino()
{
	SendNotification(NotificationRestarting);
	noInterrupts();
	for(int i = 0; i < 14; i++)
		digitalWrite(i, LOW);
	StopPeriodic();
	DeleteCommandArray();
	Serial.flush();
	_restartArduino();
}

